package com.springweb.unit3.conditional;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

import com.springweb.unit3.AnotherCDPlayer;
import com.springweb.unit3.CompactDisc;
import com.springweb.unit3.Masonry;
import com.springweb.unit3.MediaPlayer;

@Configuration
public class CDPlayerConfig {
	
	@Bean("masonry")
	public CompactDisc masonry() {
		return new Masonry();
	}
	
	@Bean("anotherCDPlayer")
	@Conditional(CDPlayerCondition.class)
	public MediaPlayer anotherCDPlayer () {
		return new AnotherCDPlayer(masonry());
	}
}
